import cv2
import numpy as np
import json



# 读取TIFF文件
tiff_file = '/Users/daxiang/Downloads/haoping.tif'
png_file = '/Users/daxiang/Downloads/aa.png'
out_file = '/Users/daxiang/Downloads/out.png'
image = cv2.imread(tiff_file, cv2.IMREAD_GRAYSCALE)


# 设置缩放比例
scale_percent = 1  # 缩放百分比，这里设置为10%
# 计算缩放后的尺寸
width = int(image.shape[1] * scale_percent / 100)
height = int(image.shape[0] * scale_percent / 100)
# 缩放图像
image = cv2.resize(image, (width, height))

# 将缩放后的图片进行输出
cv2.imwrite(out_file, image)
